﻿<%@ Page Title="" Language="C#" MasterPageFile="~/BaseInfoMaster.master" AutoEventWireup="true"
    CodeFile="BookHisQuery.aspx.cs" Inherits="Business_BookHisQuery" %>

<%@ Register Assembly="DevExpress.Web.v10.2, Version=10.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxPopupControl" TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Web.v10.2, Version=10.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxCallbackPanel" TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Web.ASPxGridView.v10.2, Version=10.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxGridView" TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Web.ASPxEditors.v10.2, Version=10.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxEditors" TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Web.v10.2, Version=10.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxPanel" TagPrefix="dx" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <link type="text/css" rel="stylesheet" href="../Content/Site.css" />
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <script type="text/javascript">
        function ShowConsumer(control) {

            PPanel.ShowAtElement(control);
        }
        function CbConsumer(id) {
            ConsumerPanel.PerformCallback(id.toString());
        }

    </script>
    <dx:ASPxPopupControl ID="ASPxPopupControl1" runat="server" ClientInstanceName="PPanel"
        Width="450px" AllowResize="true" HeaderText="客户信息" CssFilePath="~/App_Themes/DevEx/{0}/styles.css"
        CssPostfix="DevEx" EnableHotTrack="False" SpriteCssFilePath="~/App_Themes/DevEx/{0}/sprite.css">
        <LoadingPanelImage Url="~/App_Themes/DevEx/Web/Loading.gif">
        </LoadingPanelImage>
        <LoadingPanelStyle ImageSpacing="5px">
        </LoadingPanelStyle>
        <ContentCollection>
            <dx:PopupControlContentControl runat="server" SupportsDisabledAttribute="True">
                <dx:ASPxCallbackPanel ID="ConsumerPanel" ClientInstanceName="ConsumerPanel" runat="server"
                    Width="200px" OnCallback="ConsumerPanel_Callback">
                    <PanelCollection>
                        <dx:PanelContent>
                            <table width="100%" style="font-size: 10pt">
                                <tr>
                                    <td style="white-space: nowrap">
                                        客户姓名:
                                    </td>
                                    <td>
                                        <dx:ASPxLabel Width="120px" ID="View_CName" Wrap="true" runat="server" CssFilePath="~/App_Themes/DevEx/{0}/styles.css"
                                            CssPostfix="DevEx">
                                        </dx:ASPxLabel>
                                    </td>
                                    <td style="white-space: nowrap">
                                        手机号:
                                    </td>
                                    <td>
                                        <dx:ASPxLabel Width="120px" ID="View_PhoneNum" Wrap="true" runat="server" CssFilePath="~/App_Themes/DevEx/{0}/styles.css"
                                            CssPostfix="DevEx">
                                        </dx:ASPxLabel>
                                    </td>
                                </tr>
                                <tr>
                                    <td style="white-space: nowrap">
                                        部门:
                                    </td>
                                    <td>
                                        <dx:ASPxLabel Width="120px" ID="View_Department" Wrap="true" runat="server" CssFilePath="~/App_Themes/DevEx/{0}/styles.css"
                                            CssPostfix="DevEx">
                                        </dx:ASPxLabel>
                                    </td>
                                    <td style="white-space: nowrap">
                                        性别:
                                    </td>
                                    <td>
                                        <dx:ASPxLabel Width="120px" ID="View_Sex" Wrap="true" runat="server" CssFilePath="~/App_Themes/DevEx/{0}/styles.css"
                                            CssPostfix="DevEx">
                                        </dx:ASPxLabel>
                                    </td>
                                </tr>
                                <tr>
                                    <td style="white-space: nowrap">
                                        车牌/车名/颜色:
                                    </td>
                                    <td>
                                        <dx:ASPxLabel Width="120px" ID="View_Car" Wrap="true" runat="server" CssFilePath="~/App_Themes/DevEx/{0}/styles.css"
                                            CssPostfix="DevEx">
                                        </dx:ASPxLabel>
                                    </td>
                                    <td style="white-space: nowrap">
                                        重要客户:
                                    </td>
                                    <td>
                                        <dx:ASPxLabel Width="120px" ID="View_IsVip" Wrap="true" runat="server" CssFilePath="~/App_Themes/DevEx/{0}/styles.css"
                                            CssPostfix="DevEx">
                                        </dx:ASPxLabel>
                                    </td>
                                </tr>
                                <tr>
                                    <td style="white-space: nowrap">
                                        关联单位:
                                    </td>
                                    <td>
                                        <dx:ASPxLabel Width="120px" ID="View_RefrenceCompany_ID" Wrap="true" runat="server"
                                            CssFilePath="~/App_Themes/DevEx/{0}/styles.css" CssPostfix="DevEx">
                                        </dx:ASPxLabel>
                                    </td>
                                    <td style="white-space: nowrap">
                                        职位，头衔:
                                    </td>
                                    <td>
                                        <dx:ASPxLabel Width="120px" ID="View_Position" Wrap="true" runat="server" CssFilePath="~/App_Themes/DevEx/{0}/styles.css"
                                            CssPostfix="DevEx">
                                        </dx:ASPxLabel>
                                    </td>
                                </tr>
                                <tr>
                                    <td style="white-space: nowrap">
                                        单位名称:
                                    </td>
                                    <td colspan="3">
                                        <dx:ASPxLabel Width="250px" ID="View_Company" Wrap="true" runat="server" CssFilePath="~/App_Themes/DevEx/{0}/styles.css"
                                            CssPostfix="DevEx">
                                        </dx:ASPxLabel>
                                    </td>
                                </tr>
                                <tr>
                                    <td style="white-space: nowrap">
                                        地址:
                                    </td>
                                    <td colspan="3">
                                        <dx:ASPxLabel Width="250px" ID="View_Address" Wrap="true" runat="server" CssFilePath="~/App_Themes/DevEx/{0}/styles.css"
                                            CssPostfix="DevEx">
                                        </dx:ASPxLabel>
                                    </td>
                                </tr>
                                <tr>
                                    <td style="white-space: nowrap">
                                        喜好，口味:
                                    </td>
                                    <td colspan="3">
                                        <dx:ASPxLabel Width="250px" ID="View_Favor" Wrap="true" runat="server" CssFilePath="~/App_Themes/DevEx/{0}/styles.css"
                                            CssPostfix="DevEx">
                                        </dx:ASPxLabel>
                                    </td>
                                </tr>
                                <tr>
                                    <td style="white-space: nowrap">
                                        备注:
                                    </td>
                                    <td colspan="3">
                                        <dx:ASPxLabel Width="250px" ID="View_Remark" Wrap="true" runat="server" CssFilePath="~/App_Themes/DevEx/{0}/styles.css"
                                            CssPostfix="DevEx">
                                        </dx:ASPxLabel>
                                    </td>
                                </tr>
                            </table>
                        </dx:PanelContent>
                    </PanelCollection>
                </dx:ASPxCallbackPanel>
            </dx:PopupControlContentControl>
        </ContentCollection>
    </dx:ASPxPopupControl>
    <h1 class="DemoTitle">
        预定信息查询
    </h1>
    <div id="DemoArea">
        <div class="Spacer" style="height: 14px;">
        </div>
        <dx:ASPxCallbackPanel ID="QueryCBPanel" ClientInstanceName="QueryPanel" runat="server"
            CssFilePath="~/App_Themes/DevEx/{0}/styles.css" CssPostfix="DevEx" OnCallback="QueryCBPanel_Callback">
            <LoadingPanelImage Url="~/App_Themes/DevEx/Web/Loading.gif">
            </LoadingPanelImage>
            <LoadingPanelStyle ImageSpacing="5px">
            </LoadingPanelStyle>
            <PanelCollection>
                <dx:PanelContent runat="server" SupportsDisabledAttribute="True">
                    <dx:ASPxPanel ID="ASPxPanel1" ClientInstanceName="ContainerPanel" runat="server"
                        Width="100%">
                        <PanelCollection>
                            <dx:PanelContent>
                                <table>
                                    <tr>
                                        <td>
                                            开始日期：
                                        </td>
                                        <td>
                                            <dx:ASPxDateEdit ID="Query_BeginT" runat="server" CssFilePath="~/App_Themes/DevEx/{0}/styles.css"
                                                CssPostfix="DevEx" EnableAnimation="False" Font-Size="10pt" Spacing="0" SpriteCssFilePath="~/App_Themes/DevEx/{0}/sprite.css">
                                                <CalendarProperties ClearButtonText="清除" TodayButtonText="今天">
                                                    <HeaderStyle Spacing="1px" />
                                                </CalendarProperties>
                                                <ButtonStyle Width="13px">
                                                </ButtonStyle>
                                            </dx:ASPxDateEdit>
                                        </td>
                                        <td>
                                            电话号码：
                                        </td>
                                        <td>
                                            <dx:ASPxTextBox ID="Query_ContractPhoneNum" runat="server" CssFilePath="~/App_Themes/DevEx/{0}/styles.css"
                                                CssPostfix="DevEx" Font-Size="10pt" SpriteCssFilePath="~/App_Themes/DevEx/{0}/sprite.css"
                                                Width="170px">
                                            </dx:ASPxTextBox>
                                        </td>
                                        <td rowspan="3">
                                            <dx:ASPxButton ID="btnQuery" runat="server" CssFilePath="~/App_Themes/DevEx/{0}/styles.css"
                                                CssPostfix="DevEx" Font-Size="10pt" SpriteCssFilePath="~/App_Themes/DevEx/{0}/sprite.css"
                                                Text="查询" AutoPostBack="False" UseSubmitBehavior="False">
                                                <ClientSideEvents Click="function(s,e){QueryPanel.PerformCallback();ContainerPanel.ClientEnable=false; }" />
                                            </dx:ASPxButton>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            结束日期：
                                        </td>
                                        <td>
                                            <dx:ASPxDateEdit ID="Query_EndT" runat="server" CssFilePath="~/App_Themes/DevEx/{0}/styles.css"
                                                CssPostfix="DevEx" EnableAnimation="False" Font-Size="10pt" Spacing="0" SpriteCssFilePath="~/App_Themes/DevEx/{0}/sprite.css">
                                                <CalendarProperties ClearButtonText="清除" TodayButtonText="今天">
                                                    <HeaderStyle Spacing="1px" />
                                                </CalendarProperties>
                                                <ButtonStyle Width="13px">
                                                </ButtonStyle>
                                            </dx:ASPxDateEdit>
                                        </td>
                                        <td>
                                            联系人姓名：
                                        </td>
                                        <td>
                                            <dx:ASPxTextBox ID="Query_ContractName" runat="server" CssFilePath="~/App_Themes/DevEx/{0}/styles.css"
                                                CssPostfix="DevEx" Font-Size="10pt" SpriteCssFilePath="~/App_Themes/DevEx/{0}/sprite.css"
                                                Width="170px">
                                            </dx:ASPxTextBox>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            时段：
                                        </td>
                                        <td>
                                            <dx:ASPxComboBox ID="Query_Period" runat="server" CssFilePath="~/App_Themes/DevEx/{0}/styles.css"
                                                CssPostfix="DevEx" Font-Size="10pt" SpriteCssFilePath="~/App_Themes/DevEx/{0}/sprite.css"
                                                ValueType="System.String" Width="170px">
                                            </dx:ASPxComboBox>
                                        </td>
                                        <td>
                                            订金单号：
                                        </td>
                                        <td>
                                            <dx:ASPxTextBox ID="Query_BookNo" runat="server" CssFilePath="~/App_Themes/DevEx/{0}/styles.css"
                                                CssPostfix="DevEx" Font-Size="10pt" SpriteCssFilePath="~/App_Themes/DevEx/{0}/sprite.css"
                                                Width="170px">
                                            </dx:ASPxTextBox>
                                        </td>
                                    </tr>
                                </table>
                                <dx:ASPxGridView ID="gridView" runat="server" AutoGenerateColumns="False" CssFilePath="~/App_Themes/DevEx/{0}/styles.css"
                                    CssPostfix="DevEx" KeyFieldName="BookID" Width="100%">
                                    <SettingsBehavior AllowSort="false" />
                                    <SettingsDetail ShowDetailButtons="true" ShowDetailRow="true" />
                                    <Columns>
                                        <dx:GridViewDataTextColumn Caption="自动编码" FieldName="BookID" Name="t_BookID" ReadOnly="True"
                                             VisibleIndex="0">
                                            <EditFormSettings CaptionLocation="Near" />
                                            <CellStyle HorizontalAlign="Right">
                                            </CellStyle>
                                        </dx:GridViewDataTextColumn>
                                        <dx:GridViewDataTextColumn Caption="营业时段" FieldName="PeriodName" Name="t_PeriodName"
                                             VisibleIndex="1">
                                            <CellStyle HorizontalAlign="Center">
                                            </CellStyle>
                                        </dx:GridViewDataTextColumn>
                                        <dx:GridViewDataTextColumn Caption="联系人" FieldName="ContractName" Name="t_ConsumerName"
                                             VisibleIndex="2">
                                            <CellStyle HorizontalAlign="Center">
                                            </CellStyle>
                                        </dx:GridViewDataTextColumn>
                                        <dx:GridViewDataDateColumn Caption="预定日期" FieldName="BookDate" Name="t_BookDate"
                                             VisibleIndex="3">
                                            <PropertiesDateEdit Spacing="0">
                                            </PropertiesDateEdit>
                                            <CellStyle HorizontalAlign="Center">
                                            </CellStyle>
                                        </dx:GridViewDataDateColumn>
                                        <dx:GridViewDataDateColumn Caption="录入时间" FieldName="AddTime" Name="t_AddTime" 
                                            VisibleIndex="4">
                                            <PropertiesDateEdit Spacing="0">
                                            </PropertiesDateEdit>
                                            <CellStyle HorizontalAlign="Center">
                                            </CellStyle>
                                        </dx:GridViewDataDateColumn>
                                        <dx:GridViewDataTextColumn Caption="订金单号" FieldName="BookNo" Name="t_BookNo" 
                                            VisibleIndex="5">
                                            <CellStyle HorizontalAlign="Left">
                                            </CellStyle>
                                        </dx:GridViewDataTextColumn>
                                        <dx:GridViewDataTextColumn Caption="订金金额" FieldName="Money" Name="t_Money" 
                                            VisibleIndex="6">
                                            <CellStyle HorizontalAlign="Right">
                                            </CellStyle>
                                        </dx:GridViewDataTextColumn>
                                        <dx:GridViewDataTextColumn Caption="电话号码" FieldName="ContractPhoneNum" Name="t_ContractPhoneNum"
                                             VisibleIndex="7">
                                            <CellStyle HorizontalAlign="Left">
                                            </CellStyle>
                                        </dx:GridViewDataTextColumn>
                                        <dx:GridViewDataHyperLinkColumn Caption="关联客户" FieldName="Consumer_ID" Name="t_Consumer_ID"
                                             VisibleIndex="8">
                                            <DataItemTemplate>
                                                <%#
                                               (Eval("Consumer_ID") != null && !string.IsNullOrEmpty(Eval("Consumer_ID").ToString())) ?
"<a href='javascript:CbConsumer(" + Eval("Consumer_ID") + ");' onclick='javascript:ShowConsumer(this)'>信息</a>" : string.Empty
                                                %>
                                            </DataItemTemplate>
                                            <CellStyle HorizontalAlign="Left">
                                            </CellStyle>
                                        </dx:GridViewDataHyperLinkColumn>
                                    </Columns>
                                    <Images SpriteCssFilePath="~/App_Themes/DevEx/{0}/sprite.css">
                                        <LoadingPanelOnStatusBar Url="~/App_Themes/DevEx/GridView/StatusBarLoading.gif">
                                        </LoadingPanelOnStatusBar>
                                        <LoadingPanel Url="~/App_Themes/DevEx/GridView/Loading.gif">
                                        </LoadingPanel>
                                    </Images>
                                    <ImagesFilterControl>
                                        <LoadingPanel Url="~/App_Themes/DevEx/GridView/Loading.gif">
                                        </LoadingPanel>
                                    </ImagesFilterControl>
                                    <Styles CssFilePath="~/App_Themes/DevEx/{0}/styles.css" CssPostfix="DevEx">
                                        <Header ImageSpacing="5px" SortingImageSpacing="5px">
                                        </Header>
                                        <LoadingPanel ImageSpacing="5px">
                                        </LoadingPanel>
                                    </Styles>
                                    <StylesEditors ButtonEditCellSpacing="0">
                                        <ProgressBar Height="21px">
                                        </ProgressBar>
                                    </StylesEditors>
                                    <Templates>
                                    <DetailRow>
                                    <dx:ASPxGridView ID="DetailgridView" runat="server" AutoGenerateColumns="False" CssFilePath="~/App_Themes/DevEx/{0}/styles.css"
                                    CssPostfix="DevEx" KeyFieldName="TableID" Width="100%" onload="DetailgridView_Load">
                                    <SettingsDetail IsDetailGrid="true" />
                                    <SettingsBehavior AllowSort="false" />
                                    <Columns>
                                        <dx:GridViewDataTextColumn Caption="餐桌号" FieldName="TableID" Name="t_TableID" ReadOnly="True"
                                             VisibleIndex="0">
                                            <EditFormSettings CaptionLocation="Near" />
                                            <CellStyle HorizontalAlign="Right">
                                            </CellStyle>
                                        </dx:GridViewDataTextColumn>
                                        <dx:GridViewDataTextColumn Caption="桌台名" FieldName="TableName" Name="t_TableName"
                                             VisibleIndex="1">
                                            <CellStyle HorizontalAlign="Center">
                                            </CellStyle>
                                        </dx:GridViewDataTextColumn>
                                        <dx:GridViewDataTextColumn Caption="人数" FieldName="PCount" Name="t_PCount"
                                             VisibleIndex="2">
                                            <CellStyle HorizontalAlign="Right">
                                            </CellStyle>
                                        </dx:GridViewDataTextColumn>
                                        <dx:GridViewDataDateColumn Caption="区域" FieldName="AreaName" Name="t_AreaName"
                                             VisibleIndex="3">
                                            <PropertiesDateEdit Spacing="0">
                                            </PropertiesDateEdit>
                                            <CellStyle HorizontalAlign="Center">
                                            </CellStyle>
                                        </dx:GridViewDataDateColumn>
                                        <dx:GridViewDataComboBoxColumn Caption="预定状态" FieldName="State" Name="t_State" 
                                            VisibleIndex="4">
                                            <PropertiesComboBox>
                                            <Items>
                                            </Items>
                                            </PropertiesComboBox>
                                            <CellStyle HorizontalAlign="Center">
                                            </CellStyle>
                                        </dx:GridViewDataComboBoxColumn>
                                        <dx:GridViewDataDateColumn Caption="备注" FieldName="Remark" Name="t_Remark" 
                                            VisibleIndex="4">
                                            <PropertiesDateEdit Spacing="0">
                                            </PropertiesDateEdit>
                                            <CellStyle HorizontalAlign="Left">
                                            </CellStyle>
                                        </dx:GridViewDataDateColumn>
                                    </Columns>
                                    <Images SpriteCssFilePath="~/App_Themes/DevEx/{0}/sprite.css">
                                        <LoadingPanelOnStatusBar Url="~/App_Themes/DevEx/GridView/StatusBarLoading.gif">
                                        </LoadingPanelOnStatusBar>
                                        <LoadingPanel Url="~/App_Themes/DevEx/GridView/Loading.gif">
                                        </LoadingPanel>
                                    </Images>
                                    <ImagesFilterControl>
                                        <LoadingPanel Url="~/App_Themes/DevEx/GridView/Loading.gif">
                                        </LoadingPanel>
                                    </ImagesFilterControl>
                                    <Styles CssFilePath="~/App_Themes/DevEx/{0}/styles.css" CssPostfix="DevEx">
                                        <Header ImageSpacing="5px" SortingImageSpacing="5px">
                                        </Header>
                                        <LoadingPanel ImageSpacing="5px">
                                        </LoadingPanel>
                                    </Styles>
                                    <StylesEditors ButtonEditCellSpacing="0">
                                        <ProgressBar Height="21px">
                                        </ProgressBar>
                                    </StylesEditors>
                                    <SettingsPager Position="TopAndBottom" Visible="False">
                                    </SettingsPager>
                                </dx:ASPxGridView>
                                    </DetailRow>
                                    </Templates>
                                    <SettingsPager Position="TopAndBottom">
                                    </SettingsPager>
                                </dx:ASPxGridView>
                            </dx:PanelContent>
                        </PanelCollection>
                    </dx:ASPxPanel>
                </dx:PanelContent>
            </PanelCollection>
        </dx:ASPxCallbackPanel>
    </div>
</asp:Content>
